package mxmf.content.vo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 批量操作返回vo
 * @author alaspo
 *
 */
public class BatchResultVO<T> implements Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    private List<ResultVo<T>> results = new ArrayList<>();

    private void addResult(T obj, boolean success, String message) {
        this.results.add(new ResultVo<T>(obj, success, message));
    }

    public void addSuccessResult(T obj) {
        addResult(obj, true, null);
    }

    public void addErrorResult(T obj, String message) {
        addResult(obj, false, message);
    }

    public List<ResultVo<T>> getResults() {
        return results;
    }

    public void setResults(List<ResultVo<T>> results) {
        this.results = results;
    }

}
